package com.huaweicloud.sdk.das.v3.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.huaweicloud.sdk.core.SdkResponse;

import java.util.Objects;
import java.util.function.Consumer;

/**
 * Response Object
 */
public class ShowTuningResponse extends SdkResponse {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonProperty(value = "tune_result")

    private AdviceResult tuneResult;

    public ShowTuningResponse withTuneResult(AdviceResult tuneResult) {
        this.tuneResult = tuneResult;
        return this;
    }

    public ShowTuningResponse withTuneResult(Consumer<AdviceResult> tuneResultSetter) {
        if (this.tuneResult == null) {
            this.tuneResult = new AdviceResult();
            tuneResultSetter.accept(this.tuneResult);
        }

        return this;
    }

    /**
     * Get tuneResult
     * @return tuneResult
     */
    public AdviceResult getTuneResult() {
        return tuneResult;
    }

    public void setTuneResult(AdviceResult tuneResult) {
        this.tuneResult = tuneResult;
    }

    @Override
    public boolean equals(java.lang.Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
            return false;
        }
        ShowTuningResponse that = (ShowTuningResponse) obj;
        return Objects.equals(this.tuneResult, that.tuneResult);
    }

    @Override
    public int hashCode() {
        return Objects.hash(tuneResult);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ShowTuningResponse {\n");
        sb.append("    tuneResult: ").append(toIndentedString(tuneResult)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces
     * (except the first line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }

}
